{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "f3e2c8ee-c34d-4a47-8212-fc7871a74cc3",
   "metadata": {},
   "source": [
    "# Talk demo intro"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4d46818c-204e-426c-b22f-6c2e7a651ca1",
   "metadata": {},
   "outputs": [],
   "source": [
    "! pip install -q torch\n",
    "! pip install -q tensor-sensor"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e672e0c2-b516-492c-9616-781db12f9397",
   "metadata": {},
   "source": [
    "## Simulated GRU matrix algebra with dimension issue"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "43b79890-6f82-4261-b834-0b53f46d518d",
   "metadata": {},
   "outputs": [
    {
     "ename": "RuntimeError",
     "evalue": "mat1 and mat2 shapes cannot be multiplied (764x256 and 764x200)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mRuntimeError\u001b[0m                              Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-1-df89bdeb6ec1>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m     13\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     14\u001b[0m \u001b[0;31m# Following code raises an exception\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 15\u001b[0;31m \u001b[0mh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtanh\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mWhh\u001b[0m \u001b[0;34m@\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mr\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mh\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mUxh\u001b[0m \u001b[0;34m@\u001b[0m \u001b[0mX\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mbh\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mRuntimeError\u001b[0m: mat1 and mat2 shapes cannot be multiplied (764x256 and 764x200)"
     ]
    }
   ],
   "source": [
    "import torch\n",
    "\n",
    "n = 200         # number of instances\n",
    "d = 764         # number of instance features\n",
    "nhidden = 256\n",
    "\n",
    "Whh = torch.eye(nhidden, nhidden)   # Identity matrix\n",
    "Uxh = torch.randn(d, nhidden)\n",
    "bh  = torch.zeros(nhidden, 1)\n",
    "h = torch.randn(nhidden, 1)         # fake previous hidden state h\n",
    "r = torch.randn(nhidden, 1)         # fake this computation\n",
    "X = torch.rand(n,d)                 # fake input\n",
    "\n",
    "# Following code raises an exception\n",
    "h = torch.tanh(Whh @ (r*h) + Uxh @ X.T + bh)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "208a643d-2a07-40ce-9060-1ab5a80286fa",
   "metadata": {},
   "source": [
    "## TensorSensor traps, clarifies, and visualizes issues"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "83dbfd70-c784-44c5-a023-8ffa1c7f18df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"45.995716pt\" version=\"1.1\" viewBox=\"0 0 294.852769 45.995716\" width=\"294.852769pt\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-09-29T16:50:29.562933</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 45.995716  L 294.852769 45.995716  L 294.852769 0  L 0 0  z \" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path clip-path=\"url(#p2cf69eb1e8)\" d=\"M 194.67225 45.180316  L 217.52235 45.180316  L 217.52235 22.919896  L 194.67225 22.919896  z \" style=\"fill:#cfe2d4;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path clip-path=\"url(#p2cf69eb1e8)\" d=\"M 233.84385 45.180316  L 256.69395 45.180316  L 256.69395 22.919896  L 233.84385 22.919896  z \" style=\"fill:#cfe2d4;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_1\">\n",
       "    <path clip-path=\"url(#p2cf69eb1e8)\" d=\"M 195.65154 13.192653  L 216.54306 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_2\">\n",
       "    <path clip-path=\"url(#p2cf69eb1e8)\" d=\"M 234.82314 13.192653  L 255.71466 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"text_1\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(6.975 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 47.21875 0  L 38.71875 0  L 38.71875 31.296875  Q 38.71875 36.96875 36.59375 39.765625  Q 34.46875 42.578125 30.515625 42.578125  Q 28.8125 42.578125 27.3125 42.109375  Q 25.828125 41.65625 24.21875 40.5  Q 22.609375 39.359375 20.703125 37.40625  Q 18.796875 35.453125 16.3125 32.515625  L 16.3125 0  L 7.8125 0  L 7.8125 69  L 16.3125 69  L 16.3125 49.03125  L 16.015625 41.3125  Q 18.015625 43.703125 19.9375 45.328125  Q 21.875 46.96875 23.796875 48  Q 25.734375 49.03125 27.734375 49.46875  Q 29.734375 49.90625 31.890625 49.90625  Q 39.203125 49.90625 43.203125 45.4375  Q 47.21875 40.96875 47.21875 31.984375  z \" id=\"Consolas-104\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_2\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(13.5036 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path id=\"Consolas-32\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_3\">\n",
       "    <!-- = -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(20.0322 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 48.484375 31.546875  L 6.5 31.546875  L 6.5 38.71875  L 48.484375 38.71875  z M 48.484375 14.546875  L 6.5 14.546875  L 6.5 21.734375  L 48.484375 21.734375  z \" id=\"Consolas-61\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-61\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_4\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(26.5608 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_5\">\n",
       "    <!-- t -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(33.0894 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 47.3125 0.6875  Q 44.4375 -0.046875 41.359375 -0.359375  Q 38.28125 -0.6875 35.109375 -0.6875  Q 25.875 -0.6875 21.328125 3.484375  Q 16.796875 7.671875 16.796875 16.3125  L 16.796875 41.890625  L 3.078125 41.890625  L 3.078125 49.03125  L 16.796875 49.03125  L 16.796875 62.5  L 25.296875 64.703125  L 25.296875 49.03125  L 47.3125 49.03125  L 47.3125 41.890625  L 25.296875 41.890625  L 25.296875 17  Q 25.296875 11.71875 28.09375 9.109375  Q 30.90625 6.5 36.375 6.5  Q 38.71875 6.5 41.5 6.859375  Q 44.28125 7.234375 47.3125 8.015625  z \" id=\"Consolas-116\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-116\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_6\">\n",
       "    <!-- o -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(39.618 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.484375 24.90625  Q 50.484375 19.1875 48.875 14.421875  Q 47.265625 9.671875 44.234375 6.265625  Q 41.21875 2.875 36.859375 1  Q 32.515625 -0.875 27 -0.875  Q 21.734375 -0.875 17.546875 0.75  Q 13.375 2.390625 10.46875 5.5625  Q 7.5625 8.734375 6.03125 13.421875  Q 4.5 18.109375 4.5 24.21875  Q 4.5 29.9375 6.109375 34.640625  Q 7.71875 39.359375 10.734375 42.75  Q 13.765625 46.140625 18.109375 48.015625  Q 22.46875 49.90625 27.984375 49.90625  Q 33.25 49.90625 37.421875 48.265625  Q 41.609375 46.625 44.5 43.46875  Q 47.40625 40.328125 48.9375 35.640625  Q 50.484375 30.953125 50.484375 24.90625  z M 41.796875 24.515625  Q 41.796875 29.046875 40.796875 32.4375  Q 39.796875 35.84375 37.9375 38.109375  Q 36.078125 40.375 33.421875 41.515625  Q 30.765625 42.671875 27.484375 42.671875  Q 23.6875 42.671875 20.96875 41.1875  Q 18.265625 39.703125 16.53125 37.203125  Q 14.796875 34.71875 13.984375 31.421875  Q 13.1875 28.125 13.1875 24.515625  Q 13.1875 19.96875 14.1875 16.546875  Q 15.1875 13.140625 17.03125 10.859375  Q 18.890625 8.59375 21.53125 7.4375  Q 24.171875 6.296875 27.484375 6.296875  Q 31.296875 6.296875 34 7.78125  Q 36.71875 9.28125 38.453125 11.765625  Q 40.1875 14.265625 40.984375 17.546875  Q 41.796875 20.84375 41.796875 24.515625  z \" id=\"Consolas-111\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-111\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_7\">\n",
       "    <!-- r -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(46.1466 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 9.8125 49.03125  L 17.578125 49.03125  L 17.828125 39.984375  Q 22.171875 45.21875 26.390625 47.5625  Q 30.609375 49.90625 34.90625 49.90625  Q 42.53125 49.90625 46.453125 44.96875  Q 50.390625 40.046875 50.09375 30.328125  L 41.5 30.328125  Q 41.65625 36.765625 39.625 39.671875  Q 37.59375 42.578125 33.6875 42.578125  Q 31.984375 42.578125 30.25 41.96875  Q 28.515625 41.359375 26.6875 40.015625  Q 24.859375 38.671875 22.796875 36.5625  Q 20.75 34.46875 18.40625 31.5  L 18.40625 0  L 9.8125 0  z \" id=\"Consolas-114\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-114\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_8\">\n",
       "    <!-- c -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(52.6752 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 45.90625 1.8125  Q 42.578125 0.53125 39.078125 -0.078125  Q 35.59375 -0.6875 31.890625 -0.6875  Q 20.265625 -0.6875 13.984375 5.609375  Q 7.71875 11.921875 7.71875 24.03125  Q 7.71875 29.828125 9.515625 34.5625  Q 11.328125 39.3125 14.59375 42.671875  Q 17.875 46.046875 22.40625 47.875  Q 26.953125 49.703125 32.421875 49.703125  Q 36.234375 49.703125 39.546875 49.171875  Q 42.875 48.640625 45.90625 47.40625  L 45.90625 39.3125  Q 42.71875 40.96875 39.421875 41.71875  Q 36.140625 42.484375 32.625 42.484375  Q 29.34375 42.484375 26.4375 41.234375  Q 23.53125 39.984375 21.328125 37.640625  Q 19.140625 35.296875 17.875 31.921875  Q 16.609375 28.5625 16.609375 24.3125  Q 16.609375 15.4375 20.921875 11.015625  Q 25.25 6.59375 32.90625 6.59375  Q 36.375 6.59375 39.625 7.375  Q 42.875 8.15625 45.90625 9.71875  z \" id=\"Consolas-99\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-99\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_9\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(59.2038 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_10\">\n",
       "    <!-- . -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(65.7324 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 27.09375 15.375  Q 28.765625 15.375 30.25 14.734375  Q 31.734375 14.109375 32.828125 12.984375  Q 33.9375 11.859375 34.5625 10.375  Q 35.203125 8.890625 35.203125 7.171875  Q 35.203125 5.515625 34.5625 4.046875  Q 33.9375 2.59375 32.828125 1.484375  Q 31.734375 0.390625 30.25 -0.234375  Q 28.765625 -0.875 27.09375 -0.875  Q 25.390625 -0.875 23.921875 -0.234375  Q 22.46875 0.390625 21.359375 1.484375  Q 20.265625 2.59375 19.625 4.046875  Q 19 5.515625 19 7.171875  Q 19 8.890625 19.625 10.375  Q 20.265625 11.859375 21.359375 12.984375  Q 22.46875 14.109375 23.921875 14.734375  Q 25.390625 15.375 27.09375 15.375  z \" id=\"Consolas-46\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-46\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_11\">\n",
       "    <!-- t -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(72.261 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-116\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_12\">\n",
       "    <!-- a -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(78.7896 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 39.3125 0  L 39.109375 6.59375  Q 35.109375 2.640625 30.984375 0.875  Q 26.859375 -0.875 22.3125 -0.875  Q 18.109375 -0.875 15.125 0.1875  Q 12.15625 1.265625 10.21875 3.140625  Q 8.296875 5.03125 7.390625 7.5625  Q 6.5 10.109375 6.5 13.09375  Q 6.5 20.453125 11.984375 24.625  Q 17.484375 28.8125 28.21875 28.8125  L 38.375 28.8125  L 38.375 33.109375  Q 38.375 37.453125 35.59375 40.0625  Q 32.8125 42.671875 27.09375 42.671875  Q 22.953125 42.671875 18.921875 41.75  Q 14.890625 40.828125 10.59375 39.109375  L 10.59375 46.78125  Q 12.203125 47.359375 14.171875 47.921875  Q 16.15625 48.484375 18.359375 48.921875  Q 20.5625 49.359375 22.953125 49.625  Q 25.34375 49.90625 27.78125 49.90625  Q 32.234375 49.90625 35.796875 48.921875  Q 39.359375 47.953125 41.8125 45.953125  Q 44.28125 43.953125 45.59375 40.921875  Q 46.921875 37.890625 46.921875 33.796875  L 46.921875 0  z M 38.375 22.3125  L 27.59375 22.3125  Q 24.421875 22.3125 22.125 21.671875  Q 19.828125 21.046875 18.359375 19.875  Q 16.890625 18.703125 16.1875 17.0625  Q 15.484375 15.4375 15.484375 13.375  Q 15.484375 11.96875 15.921875 10.671875  Q 16.359375 9.375 17.328125 8.375  Q 18.3125 7.375 19.875 6.78125  Q 21.4375 6.203125 23.6875 6.203125  Q 26.609375 6.203125 30.390625 7.984375  Q 34.1875 9.765625 38.375 13.625  z \" id=\"Consolas-97\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-97\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_13\">\n",
       "    <!-- n -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(85.3182 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 7.8125 49.03125  L 15.375 49.03125  L 15.71875 41.109375  Q 17.875 43.65625 19.875 45.328125  Q 21.875 47.015625 23.796875 48.046875  Q 25.734375 49.078125 27.734375 49.484375  Q 29.734375 49.90625 31.890625 49.90625  Q 39.453125 49.90625 43.328125 45.4375  Q 47.21875 40.96875 47.21875 31.984375  L 47.21875 0  L 38.71875 0  L 38.71875 31.296875  Q 38.71875 37.0625 36.5625 39.8125  Q 34.421875 42.578125 30.171875 42.578125  Q 28.609375 42.578125 27.125 42.109375  Q 25.640625 41.65625 24.015625 40.5  Q 22.40625 39.359375 20.53125 37.40625  Q 18.65625 35.453125 16.3125 32.515625  L 16.3125 0  L 7.8125 0  z \" id=\"Consolas-110\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-110\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_14\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(91.8468 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_15\">\n",
       "    <!-- ( -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(98.3754 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 37.15625 -20.515625  Q 14.65625 0.34375 14.65625 25.59375  Q 14.65625 31.5 15.84375 37.375  Q 17.046875 43.265625 19.703125 49.171875  Q 22.359375 55.078125 26.734375 60.984375  Q 31.109375 66.890625 37.359375 72.703125  L 42.28125 67.671875  Q 23.34375 48.96875 23.34375 26.21875  Q 23.34375 14.890625 28.125 4.4375  Q 32.90625 -6 42.28125 -15.28125  z \" id=\"Consolas-40\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-40\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_16\">\n",
       "    <!-- W -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(104.904 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 52.78125 63.8125  L 48.484375 0  L 37.203125 0  L 29.296875 22.703125  L 27.09375 29.984375  L 24.8125 22.125  L 17.484375 0  L 6.59375 0  L 2.203125 63.8125  L 10.40625 63.8125  L 12.890625 20.40625  L 13.625 8.5  L 16.703125 18.609375  L 24.421875 42.28125  L 30.421875 42.28125  L 39.3125 16.890625  L 42.28125 8.5  L 42.484375 17.28125  L 45.015625 63.8125  z \" id=\"Consolas-87\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-87\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_17\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(111.4326 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_18\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(117.9612 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_19\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(124.4898 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_20\">\n",
       "    <!-- @ -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(131.0184 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 38.09375 19.921875  Q 37.640625 16.796875 37.59375 14.75  Q 37.546875 12.703125 37.859375 11.53125  Q 38.1875 10.359375 38.859375 9.890625  Q 39.546875 9.421875 40.578125 9.421875  Q 41.9375 9.421875 43.15625 10.859375  Q 44.390625 12.3125 45.34375 15.3125  Q 46.296875 18.3125 46.84375 22.890625  Q 47.40625 27.484375 47.40625 33.796875  Q 47.40625 40.828125 46.53125 46.34375  Q 45.65625 51.859375 43.75 55.71875  Q 41.84375 59.578125 38.796875 61.59375  Q 35.75 63.625 31.390625 63.625  Q 28.078125 63.625 24.96875 61.9375  Q 21.875 60.25 19.203125 57.203125  Q 16.546875 54.15625 14.375 49.875  Q 12.203125 45.609375 10.65625 40.421875  Q 9.125 35.25 8.265625 29.296875  Q 7.421875 23.34375 7.421875 16.890625  Q 7.421875 1.171875 12.15625 -6.5625  Q 16.890625 -14.3125 25.484375 -14.3125  Q 29.828125 -14.3125 33.59375 -13.3125  Q 37.359375 -12.3125 41.40625 -10.296875  L 41.40625 -16.609375  Q 37.40625 -18.453125 33.390625 -19.375  Q 29.390625 -20.3125 25 -20.3125  Q 12.546875 -20.3125 6.5625 -10.984375  Q 0.59375 -1.65625 0.484375 16.796875  Q 0.4375 24.171875 1.453125 30.9375  Q 2.484375 37.703125 4.40625 43.5625  Q 6.34375 49.421875 9.09375 54.21875  Q 11.859375 59.03125 15.34375 62.421875  Q 18.84375 65.828125 22.9375 67.703125  Q 27.046875 69.578125 31.6875 69.578125  Q 37.5 69.578125 41.765625 67.203125  Q 46.046875 64.84375 48.828125 60.375  Q 51.609375 55.90625 52.953125 49.40625  Q 54.296875 42.921875 54.296875 34.625  Q 54.25 26.21875 53.203125 20.234375  Q 52.15625 14.265625 50.25 10.453125  Q 48.34375 6.640625 45.625 4.859375  Q 42.921875 3.078125 39.59375 3.078125  Q 35.796875 3.078125 33.9375 5.03125  Q 32.078125 6.984375 32.078125 10.296875  Q 30.21875 6.546875 28.0625 4.8125  Q 25.921875 3.078125 22.90625 3.078125  Q 18.3125 3.078125 16.015625 6.515625  Q 13.71875 9.96875 13.71875 17.390625  Q 13.71875 20.0625 14.03125 23.140625  Q 14.359375 26.21875 15.109375 29.3125  Q 15.875 32.421875 17.09375 35.28125  Q 18.3125 38.140625 20.09375 40.3125  Q 21.875 42.484375 24.3125 43.796875  Q 26.765625 45.125 29.890625 45.125  Q 31.734375 45.125 33.34375 44.671875  Q 34.96875 44.234375 35.6875 43.796875  L 42 45.3125  z M 33.109375 37.3125  Q 32.671875 37.890625 31.765625 38.34375  Q 30.859375 38.8125 29.5 38.8125  Q 28.03125 38.8125 26.859375 37.78125  Q 25.6875 36.765625 24.78125 35.046875  Q 23.875 33.34375 23.265625 31.171875  Q 22.65625 29 22.234375 26.703125  Q 21.828125 24.421875 21.65625 22.1875  Q 21.484375 19.96875 21.484375 18.21875  Q 21.484375 13.53125 22.0625 11.46875  Q 22.65625 9.421875 24.3125 9.421875  Q 24.90625 9.421875 25.484375 9.65625  Q 26.078125 9.90625 26.734375 10.609375  Q 27.390625 11.328125 28.171875 12.59375  Q 28.953125 13.875 29.890625 15.921875  z \" id=\"Consolas-64\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-64\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_21\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(137.547 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_22\">\n",
       "    <!-- ( -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(144.0756 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-40\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_23\">\n",
       "    <!-- r -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(150.6042 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-114\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_24\">\n",
       "    <!-- * -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(157.1328 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 46.921875 41.015625  L 43.609375 35.203125  L 29.890625 44.28125  L 31 27.59375  L 24.03125 27.59375  L 25.09375 44.28125  L 11.078125 35.203125  L 8.015625 40.921875  L 23 48.296875  L 8.015625 55.8125  L 11.375 61.53125  L 25.203125 52.296875  L 24.03125 69  L 31 69  L 29.78125 52.296875  L 43.609375 61.625  L 47.015625 55.609375  L 31.984375 48.1875  z \" id=\"Consolas-42\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-42\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_25\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(163.6614 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_26\">\n",
       "    <!-- ) -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(170.19 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 17.828125 72.703125  Q 40.328125 51.859375 40.328125 26.3125  Q 40.328125 21.046875 39.25 15.375  Q 38.1875 9.71875 35.59375 3.78125  Q 33.015625 -2.15625 28.640625 -8.25  Q 24.265625 -14.359375 17.625 -20.515625  L 12.703125 -15.484375  Q 22.21875 -6.0625 26.90625 4.1875  Q 31.59375 14.453125 31.59375 25.6875  Q 31.59375 48.921875 12.703125 67.484375  z \" id=\"Consolas-41\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-41\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_27\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(176.7186 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_28\">\n",
       "    <!-- + -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(183.2472 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.875 22.90625  L 31.6875 22.90625  L 31.6875 2.984375  L 23.296875 2.984375  L 23.296875 22.90625  L 4.109375 22.90625  L 4.109375 30.328125  L 23.296875 30.328125  L 23.296875 50.09375  L 31.6875 50.09375  L 31.6875 30.328125  L 50.875 30.328125  z \" id=\"Consolas-43\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-43\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_29\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(189.7758 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_30\">\n",
       "    <!-- U -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(196.3044 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 49.703125 22.21875  Q 49.703125 16.9375 48.21875 12.671875  Q 46.734375 8.40625 43.84375 5.390625  Q 40.96875 2.390625 36.796875 0.75  Q 32.625 -0.875 27.203125 -0.875  Q 21.234375 -0.875 17.078125 0.6875  Q 12.9375 2.25 10.328125 5.09375  Q 7.71875 7.953125 6.515625 11.953125  Q 5.328125 15.96875 5.328125 20.90625  L 5.328125 63.8125  L 14.015625 63.8125  L 14.015625 21.578125  Q 14.015625 17.828125 14.71875 14.984375  Q 15.4375 12.15625 17.046875 10.25  Q 18.65625 8.34375 21.21875 7.359375  Q 23.78125 6.390625 27.484375 6.390625  Q 34.421875 6.390625 37.71875 10.390625  Q 41.015625 14.40625 41.015625 21.6875  L 41.015625 63.8125  L 49.703125 63.8125  z \" id=\"Consolas-85\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-85\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_31\">\n",
       "    <!-- x -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(202.833 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 52 0  L 40.71875 0  L 27.484375 18.703125  L 14.40625 0  L 3.421875 0  L 22.40625 24.609375  L 4.296875 49.03125  L 15.1875 49.03125  L 28.078125 30.171875  L 40.71875 49.03125  L 51.21875 49.03125  L 32.8125 24.421875  z \" id=\"Consolas-120\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-120\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_32\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(209.3616 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_33\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(215.8902 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_34\">\n",
       "    <!-- @ -->\n",
       "    <g style=\"fill:#a40227;\" transform=\"translate(222.4188 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-64\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_35\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(228.9474 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_36\">\n",
       "    <!-- X -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(235.476 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 53.8125 0  L 42.828125 0  L 27.296875 25.78125  L 11.71875 0  L 0.875 0  L 22.125 32.625  L 2.59375 63.8125  L 12.890625 63.8125  L 27.484375 39.796875  L 42.1875 63.8125  L 52.203125 63.8125  L 32.625 33.015625  z \" id=\"Consolas-88\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-88\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_37\">\n",
       "    <!-- . -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(242.0046 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-46\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_38\">\n",
       "    <!-- T -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(248.5332 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.78125 56.390625  L 31.890625 56.390625  L 31.890625 0  L 23.09375 0  L 23.09375 56.390625  L 4.203125 56.390625  L 4.203125 63.8125  L 50.78125 63.8125  z \" id=\"Consolas-84\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-84\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_39\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(255.0618 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_40\">\n",
       "    <!-- + -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(261.5904 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-43\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_41\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(268.119 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_42\">\n",
       "    <!-- b -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(274.6476 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 49.703125 25.390625  Q 49.703125 19.28125 48.015625 14.46875  Q 46.34375 9.671875 43.234375 6.328125  Q 40.140625 2.984375 35.6875 1.1875  Q 31.25 -0.59375 25.6875 -0.59375  Q 21.34375 -0.59375 16.796875 0.234375  Q 12.25 1.078125 7.8125 2.875  L 7.8125 69  L 16.3125 69  L 16.3125 50  L 15.921875 40.921875  Q 19.578125 45.84375 23.75 47.875  Q 27.9375 49.90625 32.71875 49.90625  Q 36.921875 49.90625 40.09375 48.140625  Q 43.265625 46.390625 45.40625 43.1875  Q 47.5625 39.984375 48.625 35.46875  Q 49.703125 30.953125 49.703125 25.390625  z M 41.015625 25  Q 41.015625 28.859375 40.453125 32.078125  Q 39.890625 35.296875 38.671875 37.59375  Q 37.453125 39.890625 35.546875 41.1875  Q 33.640625 42.484375 31 42.484375  Q 29.390625 42.484375 27.734375 41.96875  Q 26.078125 41.453125 24.296875 40.25  Q 22.515625 39.0625 20.53125 37.078125  Q 18.5625 35.109375 16.3125 32.171875  L 16.3125 8.40625  Q 18.796875 7.421875 21.375 6.859375  Q 23.96875 6.296875 26.3125 6.296875  Q 29.25 6.296875 31.90625 7.21875  Q 34.578125 8.15625 36.59375 10.328125  Q 38.625 12.5 39.8125 16.078125  Q 41.015625 19.671875 41.015625 25  z \" id=\"Consolas-98\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-98\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_43\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(281.1762 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_44\">\n",
       "    <!-- ) -->\n",
       "    <g style=\"fill:#b4b4b4;\" transform=\"translate(287.7048 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-41\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_45\">\n",
       "    <!-- 764 -->\n",
       "    <g transform=\"translate(192.8835 41.557371)rotate(-90)scale(0.09 -0.09)\">\n",
       "     <defs>\n",
       "      <path d=\"M 4.734375 62.203125  L 4.734375 70.65625  L 51.078125 70.65625  L 51.078125 63.8125  Q 44.234375 56.546875 37.515625 44.484375  Q 30.8125 32.421875 27.15625 19.671875  Q 24.515625 10.6875 23.78125 0  L 14.75 0  Q 14.890625 8.453125 18.0625 20.40625  Q 21.234375 32.375 27.171875 43.484375  Q 33.109375 54.59375 39.796875 62.203125  z \" id=\"ArialMT-55\"/>\n",
       "      <path d=\"M 49.75 54.046875  L 41.015625 53.375  Q 39.84375 58.546875 37.703125 60.890625  Q 34.125 64.65625 28.90625 64.65625  Q 24.703125 64.65625 21.53125 62.3125  Q 17.390625 59.28125 14.984375 53.46875  Q 12.59375 47.65625 12.5 36.921875  Q 15.671875 41.75 20.265625 44.09375  Q 24.859375 46.4375 29.890625 46.4375  Q 38.671875 46.4375 44.84375 39.96875  Q 51.03125 33.5 51.03125 23.25  Q 51.03125 16.5 48.125 10.71875  Q 45.21875 4.9375 40.140625 1.859375  Q 35.0625 -1.21875 28.609375 -1.21875  Q 17.625 -1.21875 10.6875 6.859375  Q 3.765625 14.9375 3.765625 33.5  Q 3.765625 54.25 11.421875 63.671875  Q 18.109375 71.875 29.4375 71.875  Q 37.890625 71.875 43.28125 67.140625  Q 48.6875 62.40625 49.75 54.046875  z M 13.875 23.1875  Q 13.875 18.65625 15.796875 14.5  Q 17.71875 10.359375 21.1875 8.171875  Q 24.65625 6 28.46875 6  Q 34.03125 6 38.03125 10.484375  Q 42.046875 14.984375 42.046875 22.703125  Q 42.046875 30.125 38.078125 34.390625  Q 34.125 38.671875 28.125 38.671875  Q 22.171875 38.671875 18.015625 34.390625  Q 13.875 30.125 13.875 23.1875  z \" id=\"ArialMT-54\"/>\n",
       "      <path d=\"M 32.328125 0  L 32.328125 17.140625  L 1.265625 17.140625  L 1.265625 25.203125  L 33.9375 71.578125  L 41.109375 71.578125  L 41.109375 25.203125  L 50.78125 25.203125  L 50.78125 17.140625  L 41.109375 17.140625  L 41.109375 0  z M 32.328125 25.203125  L 32.328125 57.46875  L 9.90625 25.203125  z \" id=\"ArialMT-52\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#ArialMT-55\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-54\"/>\n",
       "     <use x=\"111.230469\" xlink:href=\"#ArialMT-52\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_46\">\n",
       "    <!-- 256 -->\n",
       "    <g transform=\"translate(198.590034 21.560896)scale(0.09 -0.09)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.34375 8.453125  L 50.34375 0  L 3.03125 0  Q 2.9375 3.171875 4.046875 6.109375  Q 5.859375 10.9375 9.828125 15.625  Q 13.8125 20.3125 21.34375 26.46875  Q 33.015625 36.03125 37.109375 41.625  Q 41.21875 47.21875 41.21875 52.203125  Q 41.21875 57.421875 37.46875 61  Q 33.734375 64.59375 27.734375 64.59375  Q 21.390625 64.59375 17.578125 60.78125  Q 13.765625 56.984375 13.71875 50.25  L 4.6875 51.171875  Q 5.609375 61.28125 11.65625 66.578125  Q 17.71875 71.875 27.9375 71.875  Q 38.234375 71.875 44.234375 66.15625  Q 50.25 60.453125 50.25 52  Q 50.25 47.703125 48.484375 43.546875  Q 46.734375 39.40625 42.65625 34.8125  Q 38.578125 30.21875 29.109375 22.21875  Q 21.1875 15.578125 18.9375 13.203125  Q 16.703125 10.84375 15.234375 8.453125  z \" id=\"ArialMT-50\"/>\n",
       "      <path d=\"M 4.15625 18.75  L 13.375 19.53125  Q 14.40625 12.796875 18.140625 9.390625  Q 21.875 6 27.15625 6  Q 33.5 6 37.890625 10.78125  Q 42.28125 15.578125 42.28125 23.484375  Q 42.28125 31 38.0625 35.34375  Q 33.84375 39.703125 27 39.703125  Q 22.75 39.703125 19.328125 37.765625  Q 15.921875 35.84375 13.96875 32.765625  L 5.71875 33.84375  L 12.640625 70.609375  L 48.25 70.609375  L 48.25 62.203125  L 19.671875 62.203125  L 15.828125 42.96875  Q 22.265625 47.46875 29.34375 47.46875  Q 38.71875 47.46875 45.15625 40.96875  Q 51.609375 34.46875 51.609375 24.265625  Q 51.609375 14.546875 45.953125 7.46875  Q 39.0625 -1.21875 27.15625 -1.21875  Q 17.390625 -1.21875 11.203125 4.25  Q 5.03125 9.71875 4.15625 18.75  z \" id=\"ArialMT-53\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-53\"/>\n",
       "     <use x=\"111.230469\" xlink:href=\"#ArialMT-54\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_47\">\n",
       "    <!-- 764 -->\n",
       "    <g transform=\"translate(232.0551 41.557371)rotate(-90)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-55\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-54\"/>\n",
       "     <use x=\"111.230469\" xlink:href=\"#ArialMT-52\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_48\">\n",
       "    <!-- 200 -->\n",
       "    <g transform=\"translate(237.761634 21.560896)scale(0.09 -0.09)\">\n",
       "     <defs>\n",
       "      <path d=\"M 4.15625 35.296875  Q 4.15625 48 6.765625 55.734375  Q 9.375 63.484375 14.515625 67.671875  Q 19.671875 71.875 27.484375 71.875  Q 33.25 71.875 37.59375 69.546875  Q 41.9375 67.234375 44.765625 62.859375  Q 47.609375 58.5 49.21875 52.21875  Q 50.828125 45.953125 50.828125 35.296875  Q 50.828125 22.703125 48.234375 14.96875  Q 45.65625 7.234375 40.5 3  Q 35.359375 -1.21875 27.484375 -1.21875  Q 17.140625 -1.21875 11.234375 6.203125  Q 4.15625 15.140625 4.15625 35.296875  z M 13.1875 35.296875  Q 13.1875 17.671875 17.3125 11.828125  Q 21.4375 6 27.484375 6  Q 33.546875 6 37.671875 11.859375  Q 41.796875 17.71875 41.796875 35.296875  Q 41.796875 52.984375 37.671875 58.78125  Q 33.546875 64.59375 27.390625 64.59375  Q 21.34375 64.59375 17.71875 59.46875  Q 13.1875 52.9375 13.1875 35.296875  z \" id=\"ArialMT-48\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-48\"/>\n",
       "     <use x=\"111.230469\" xlink:href=\"#ArialMT-48\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p2cf69eb1e8\">\n",
       "   <rect height=\"41.491069\" width=\"294.2334\" x=\"0\" y=\"4.504646\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "ename": "RuntimeError",
     "evalue": "mat1 and mat2 shapes cannot be multiplied (764x256 and 764x200)\nCause: @ on tensor operand Uxh w/shape [764, 256] and operand X.T w/shape [764, 200]",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mRuntimeError\u001b[0m                              Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-3-b9a515efa8ef>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      3\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mtsensor\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclarify\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m     \u001b[0mh\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtanh\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mWhh\u001b[0m \u001b[0;34m@\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mr\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mh\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mUxh\u001b[0m \u001b[0;34m@\u001b[0m \u001b[0mX\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mbh\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mRuntimeError\u001b[0m: mat1 and mat2 shapes cannot be multiplied (764x256 and 764x200)\nCause: @ on tensor operand Uxh w/shape [764, 256] and operand X.T w/shape [764, 200]"
     ]
    }
   ],
   "source": [
    "import tsensor\n",
    "\n",
    "with tsensor.clarify():\n",
    "    h = torch.tanh(Whh @ (r*h) + Uxh @ X.T + bh)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9ce7ac3e-c01a-493e-97f6-2b6305dbd4f3",
   "metadata": {},
   "source": [
    "TensorSensor has augmented the exception object's message with:\n",
    "\n",
    "```\n",
    "Cause: @ on tensor operand Uxh w/shape [764, 256] and operand X.T w/shape [764, 200]\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8a451d9c-8fcd-41d0-b140-a7affdb0a1fa",
   "metadata": {},
   "source": [
    "## Fix error and clarify() does nothing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "0d0b044c-dce0-4a3c-9a4b-de0c4bd1e27f",
   "metadata": {},
   "outputs": [],
   "source": [
    "Uxh = torch.randn(nhidden, d)\n",
    "with tsensor.clarify():\n",
    "    h = torch.tanh(Whh @ (r*h) + Uxh @ X.T + bh)  # state vector update equation"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "96b5ed0f-e9a5-4270-be5e-deadc5d35fbd",
   "metadata": {},
   "source": [
    "## Explaining code w/o errors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "37c4e6ba-2d59-486d-836d-c81b0f026e8a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"45.995716pt\" version=\"1.1\" viewBox=\"0 0 119.18349 45.995716\" width=\"119.18349pt\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-09-29T16:51:10.175346</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 45.995716  L 119.18349 45.995716  L 119.18349 0  L 0 0  z \" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path clip-path=\"url(#pf600d03959)\" d=\"M 8.230781 45.180316  L 13.453661 45.180316  L 13.453661 22.919896  L 8.230781 22.919896  z \" style=\"fill:#cfe2d4;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path clip-path=\"url(#pf600d03959)\" d=\"M 106.159781 45.180316  L 111.382661 45.180316  L 111.382661 22.919896  L 106.159781 22.919896  z \" style=\"fill:#cfe2d4;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_1\">\n",
       "    <path clip-path=\"url(#pf600d03959)\" d=\"M 6.925061 13.192653  L 14.759381 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_2\">\n",
       "    <path clip-path=\"url(#pf600d03959)\" d=\"M 104.854061 13.192653  L 112.688381 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"text_1\">\n",
       "    <!-- a -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(7.577921 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 39.3125 0  L 39.109375 6.59375  Q 35.109375 2.640625 30.984375 0.875  Q 26.859375 -0.875 22.3125 -0.875  Q 18.109375 -0.875 15.125 0.1875  Q 12.15625 1.265625 10.21875 3.140625  Q 8.296875 5.03125 7.390625 7.5625  Q 6.5 10.109375 6.5 13.09375  Q 6.5 20.453125 11.984375 24.625  Q 17.484375 28.8125 28.21875 28.8125  L 38.375 28.8125  L 38.375 33.109375  Q 38.375 37.453125 35.59375 40.0625  Q 32.8125 42.671875 27.09375 42.671875  Q 22.953125 42.671875 18.921875 41.75  Q 14.890625 40.828125 10.59375 39.109375  L 10.59375 46.78125  Q 12.203125 47.359375 14.171875 47.921875  Q 16.15625 48.484375 18.359375 48.921875  Q 20.5625 49.359375 22.953125 49.625  Q 25.34375 49.90625 27.78125 49.90625  Q 32.234375 49.90625 35.796875 48.921875  Q 39.359375 47.953125 41.8125 45.953125  Q 44.28125 43.953125 45.59375 40.921875  Q 46.921875 37.890625 46.921875 33.796875  L 46.921875 0  z M 38.375 22.3125  L 27.59375 22.3125  Q 24.421875 22.3125 22.125 21.671875  Q 19.828125 21.046875 18.359375 19.875  Q 16.890625 18.703125 16.1875 17.0625  Q 15.484375 15.4375 15.484375 13.375  Q 15.484375 11.96875 15.921875 10.671875  Q 16.359375 9.375 17.328125 8.375  Q 18.3125 7.375 19.875 6.78125  Q 21.4375 6.203125 23.6875 6.203125  Q 26.609375 6.203125 30.390625 7.984375  Q 34.1875 9.765625 38.375 13.625  z \" id=\"Consolas-97\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-97\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_2\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(14.106521 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path id=\"Consolas-32\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_3\">\n",
       "    <!-- = -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(20.635121 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 48.484375 31.546875  L 6.5 31.546875  L 6.5 38.71875  L 48.484375 38.71875  z M 48.484375 14.546875  L 6.5 14.546875  L 6.5 21.734375  L 48.484375 21.734375  z \" id=\"Consolas-61\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-61\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_4\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(27.163721 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_5\">\n",
       "    <!-- t -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(33.692321 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 47.3125 0.6875  Q 44.4375 -0.046875 41.359375 -0.359375  Q 38.28125 -0.6875 35.109375 -0.6875  Q 25.875 -0.6875 21.328125 3.484375  Q 16.796875 7.671875 16.796875 16.3125  L 16.796875 41.890625  L 3.078125 41.890625  L 3.078125 49.03125  L 16.796875 49.03125  L 16.796875 62.5  L 25.296875 64.703125  L 25.296875 49.03125  L 47.3125 49.03125  L 47.3125 41.890625  L 25.296875 41.890625  L 25.296875 17  Q 25.296875 11.71875 28.09375 9.109375  Q 30.90625 6.5 36.375 6.5  Q 38.71875 6.5 41.5 6.859375  Q 44.28125 7.234375 47.3125 8.015625  z \" id=\"Consolas-116\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-116\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_6\">\n",
       "    <!-- o -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(40.220921 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.484375 24.90625  Q 50.484375 19.1875 48.875 14.421875  Q 47.265625 9.671875 44.234375 6.265625  Q 41.21875 2.875 36.859375 1  Q 32.515625 -0.875 27 -0.875  Q 21.734375 -0.875 17.546875 0.75  Q 13.375 2.390625 10.46875 5.5625  Q 7.5625 8.734375 6.03125 13.421875  Q 4.5 18.109375 4.5 24.21875  Q 4.5 29.9375 6.109375 34.640625  Q 7.71875 39.359375 10.734375 42.75  Q 13.765625 46.140625 18.109375 48.015625  Q 22.46875 49.90625 27.984375 49.90625  Q 33.25 49.90625 37.421875 48.265625  Q 41.609375 46.625 44.5 43.46875  Q 47.40625 40.328125 48.9375 35.640625  Q 50.484375 30.953125 50.484375 24.90625  z M 41.796875 24.515625  Q 41.796875 29.046875 40.796875 32.4375  Q 39.796875 35.84375 37.9375 38.109375  Q 36.078125 40.375 33.421875 41.515625  Q 30.765625 42.671875 27.484375 42.671875  Q 23.6875 42.671875 20.96875 41.1875  Q 18.265625 39.703125 16.53125 37.203125  Q 14.796875 34.71875 13.984375 31.421875  Q 13.1875 28.125 13.1875 24.515625  Q 13.1875 19.96875 14.1875 16.546875  Q 15.1875 13.140625 17.03125 10.859375  Q 18.890625 8.59375 21.53125 7.4375  Q 24.171875 6.296875 27.484375 6.296875  Q 31.296875 6.296875 34 7.78125  Q 36.71875 9.28125 38.453125 11.765625  Q 40.1875 14.265625 40.984375 17.546875  Q 41.796875 20.84375 41.796875 24.515625  z \" id=\"Consolas-111\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-111\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_7\">\n",
       "    <!-- r -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(46.749521 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 9.8125 49.03125  L 17.578125 49.03125  L 17.828125 39.984375  Q 22.171875 45.21875 26.390625 47.5625  Q 30.609375 49.90625 34.90625 49.90625  Q 42.53125 49.90625 46.453125 44.96875  Q 50.390625 40.046875 50.09375 30.328125  L 41.5 30.328125  Q 41.65625 36.765625 39.625 39.671875  Q 37.59375 42.578125 33.6875 42.578125  Q 31.984375 42.578125 30.25 41.96875  Q 28.515625 41.359375 26.6875 40.015625  Q 24.859375 38.671875 22.796875 36.5625  Q 20.75 34.46875 18.40625 31.5  L 18.40625 0  L 9.8125 0  z \" id=\"Consolas-114\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-114\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_8\">\n",
       "    <!-- c -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(53.278121 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 45.90625 1.8125  Q 42.578125 0.53125 39.078125 -0.078125  Q 35.59375 -0.6875 31.890625 -0.6875  Q 20.265625 -0.6875 13.984375 5.609375  Q 7.71875 11.921875 7.71875 24.03125  Q 7.71875 29.828125 9.515625 34.5625  Q 11.328125 39.3125 14.59375 42.671875  Q 17.875 46.046875 22.40625 47.875  Q 26.953125 49.703125 32.421875 49.703125  Q 36.234375 49.703125 39.546875 49.171875  Q 42.875 48.640625 45.90625 47.40625  L 45.90625 39.3125  Q 42.71875 40.96875 39.421875 41.71875  Q 36.140625 42.484375 32.625 42.484375  Q 29.34375 42.484375 26.4375 41.234375  Q 23.53125 39.984375 21.328125 37.640625  Q 19.140625 35.296875 17.875 31.921875  Q 16.609375 28.5625 16.609375 24.3125  Q 16.609375 15.4375 20.921875 11.015625  Q 25.25 6.59375 32.90625 6.59375  Q 36.375 6.59375 39.625 7.375  Q 42.875 8.15625 45.90625 9.71875  z \" id=\"Consolas-99\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-99\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_9\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(59.806721 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 47.21875 0  L 38.71875 0  L 38.71875 31.296875  Q 38.71875 36.96875 36.59375 39.765625  Q 34.46875 42.578125 30.515625 42.578125  Q 28.8125 42.578125 27.3125 42.109375  Q 25.828125 41.65625 24.21875 40.5  Q 22.609375 39.359375 20.703125 37.40625  Q 18.796875 35.453125 16.3125 32.515625  L 16.3125 0  L 7.8125 0  L 7.8125 69  L 16.3125 69  L 16.3125 49.03125  L 16.015625 41.3125  Q 18.015625 43.703125 19.9375 45.328125  Q 21.875 46.96875 23.796875 48  Q 25.734375 49.03125 27.734375 49.46875  Q 29.734375 49.90625 31.890625 49.90625  Q 39.203125 49.90625 43.203125 45.4375  Q 47.21875 40.96875 47.21875 31.984375  z \" id=\"Consolas-104\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_10\">\n",
       "    <!-- . -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(66.335321 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 27.09375 15.375  Q 28.765625 15.375 30.25 14.734375  Q 31.734375 14.109375 32.828125 12.984375  Q 33.9375 11.859375 34.5625 10.375  Q 35.203125 8.890625 35.203125 7.171875  Q 35.203125 5.515625 34.5625 4.046875  Q 33.9375 2.59375 32.828125 1.484375  Q 31.734375 0.390625 30.25 -0.234375  Q 28.765625 -0.875 27.09375 -0.875  Q 25.390625 -0.875 23.921875 -0.234375  Q 22.46875 0.390625 21.359375 1.484375  Q 20.265625 2.59375 19.625 4.046875  Q 19 5.515625 19 7.171875  Q 19 8.890625 19.625 10.375  Q 20.265625 11.859375 21.359375 12.984375  Q 22.46875 14.109375 23.921875 14.734375  Q 25.390625 15.375 27.09375 15.375  z \" id=\"Consolas-46\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-46\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_11\">\n",
       "    <!-- r -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(72.863921 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-114\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_12\">\n",
       "    <!-- e -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(79.392521 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 49.21875 27.09375  Q 49.21875 25.296875 49.171875 24.078125  Q 49.125 22.859375 49.03125 21.78125  L 14.59375 21.78125  Q 14.59375 14.265625 18.796875 10.234375  Q 23 6.203125 30.90625 6.203125  Q 33.0625 6.203125 35.203125 6.375  Q 37.359375 6.546875 39.359375 6.828125  Q 41.359375 7.125 43.1875 7.484375  Q 45.015625 7.859375 46.578125 8.296875  L 46.578125 1.3125  Q 43.109375 0.34375 38.734375 -0.265625  Q 34.375 -0.875 29.6875 -0.875  Q 23.390625 -0.875 18.84375 0.828125  Q 14.3125 2.546875 11.40625 5.78125  Q 8.5 9.03125 7.109375 13.734375  Q 5.71875 18.453125 5.71875 24.421875  Q 5.71875 29.59375 7.203125 34.203125  Q 8.6875 38.8125 11.546875 42.296875  Q 14.40625 45.796875 18.546875 47.84375  Q 22.703125 49.90625 27.984375 49.90625  Q 33.109375 49.90625 37.0625 48.296875  Q 41.015625 46.6875 43.71875 43.71875  Q 46.4375 40.765625 47.828125 36.546875  Q 49.21875 32.328125 49.21875 27.09375  z M 40.375 28.328125  Q 40.53125 31.59375 39.75 34.296875  Q 38.96875 37.015625 37.328125 38.96875  Q 35.6875 40.921875 33.25 42.015625  Q 30.8125 43.109375 27.59375 43.109375  Q 24.8125 43.109375 22.515625 42.03125  Q 20.21875 40.96875 18.546875 39.015625  Q 16.890625 37.0625 15.859375 34.328125  Q 14.84375 31.59375 14.59375 28.328125  z \" id=\"Consolas-101\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-101\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_13\">\n",
       "    <!-- l -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(85.921121 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 24.515625 62.015625  L 10.015625 62.015625  L 10.015625 69  L 33.109375 69  L 33.109375 7.078125  L 47.703125 7.078125  L 47.703125 0  L 8.40625 0  L 8.40625 7.078125  L 24.515625 7.078125  z \" id=\"Consolas-108\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-108\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_14\">\n",
       "    <!-- u -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(92.449721 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 47.21875 0  L 39.59375 0  L 39.3125 7.90625  Q 37.109375 5.375 35.125 3.6875  Q 33.15625 2 31.203125 0.96875  Q 29.25 -0.046875 27.265625 -0.453125  Q 25.296875 -0.875 23.09375 -0.875  Q 15.53125 -0.875 11.671875 3.5625  Q 7.8125 8.015625 7.8125 17  L 7.8125 49.03125  L 16.3125 49.03125  L 16.3125 17.671875  Q 16.3125 6.390625 24.8125 6.390625  Q 26.375 6.390625 27.859375 6.859375  Q 29.34375 7.328125 30.984375 8.46875  Q 32.625 9.625 34.5 11.578125  Q 36.375 13.53125 38.71875 16.5  L 38.71875 49.03125  L 47.21875 49.03125  z \" id=\"Consolas-117\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-117\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_15\">\n",
       "    <!-- ( -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(98.978321 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 37.15625 -20.515625  Q 14.65625 0.34375 14.65625 25.59375  Q 14.65625 31.5 15.84375 37.375  Q 17.046875 43.265625 19.703125 49.171875  Q 22.359375 55.078125 26.734375 60.984375  Q 31.109375 66.890625 37.359375 72.703125  L 42.28125 67.671875  Q 23.34375 48.96875 23.34375 26.21875  Q 23.34375 14.890625 28.125 4.4375  Q 32.90625 -6 42.28125 -15.28125  z \" id=\"Consolas-40\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-40\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_16\">\n",
       "    <!-- x -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(105.506921 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 52 0  L 40.71875 0  L 27.484375 18.703125  L 14.40625 0  L 3.421875 0  L 22.40625 24.609375  L 4.296875 49.03125  L 15.1875 49.03125  L 28.078125 30.171875  L 40.71875 49.03125  L 51.21875 49.03125  L 32.8125 24.421875  z \" id=\"Consolas-120\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-120\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_17\">\n",
       "    <!-- ) -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(112.035521 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 17.828125 72.703125  Q 40.328125 51.859375 40.328125 26.3125  Q 40.328125 21.046875 39.25 15.375  Q 38.1875 9.71875 35.59375 3.78125  Q 33.015625 -2.15625 28.640625 -8.25  Q 24.265625 -14.359375 17.625 -20.515625  L 12.703125 -15.484375  Q 22.21875 -6.0625 26.90625 4.1875  Q 31.59375 14.453125 31.59375 25.6875  Q 31.59375 48.921875 12.703125 67.484375  z \" id=\"Consolas-41\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-41\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_18\">\n",
       "    <!-- 2k -->\n",
       "    <g transform=\"translate(6.442031 38.802528)rotate(-90)scale(0.09 -0.09)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.34375 8.453125  L 50.34375 0  L 3.03125 0  Q 2.9375 3.171875 4.046875 6.109375  Q 5.859375 10.9375 9.828125 15.625  Q 13.8125 20.3125 21.34375 26.46875  Q 33.015625 36.03125 37.109375 41.625  Q 41.21875 47.21875 41.21875 52.203125  Q 41.21875 57.421875 37.46875 61  Q 33.734375 64.59375 27.734375 64.59375  Q 21.390625 64.59375 17.578125 60.78125  Q 13.765625 56.984375 13.71875 50.25  L 4.6875 51.171875  Q 5.609375 61.28125 11.65625 66.578125  Q 17.71875 71.875 27.9375 71.875  Q 38.234375 71.875 44.234375 66.15625  Q 50.25 60.453125 50.25 52  Q 50.25 47.703125 48.484375 43.546875  Q 46.734375 39.40625 42.65625 34.8125  Q 38.578125 30.21875 29.109375 22.21875  Q 21.1875 15.578125 18.9375 13.203125  Q 16.703125 10.84375 15.234375 8.453125  z \" id=\"ArialMT-50\"/>\n",
       "      <path d=\"M 6.640625 0  L 6.640625 71.578125  L 15.4375 71.578125  L 15.4375 30.765625  L 36.234375 51.859375  L 47.609375 51.859375  L 27.78125 32.625  L 49.609375 0  L 38.765625 0  L 21.625 26.515625  L 15.4375 20.5625  L 15.4375 0  z \" id=\"ArialMT-107\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-107\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_19\">\n",
       "    <!-- 1 -->\n",
       "    <g transform=\"translate(8.339799 21.560896)scale(0.09 -0.09)\">\n",
       "     <defs>\n",
       "      <path d=\"M 37.25 0  L 28.46875 0  L 28.46875 56  Q 25.296875 52.984375 20.140625 49.953125  Q 14.984375 46.921875 10.890625 45.40625  L 10.890625 53.90625  Q 18.265625 57.375 23.78125 62.296875  Q 29.296875 67.234375 31.59375 71.875  L 37.25 71.875  z \" id=\"ArialMT-49\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#ArialMT-49\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_20\">\n",
       "    <!-- 2k -->\n",
       "    <g transform=\"translate(104.371031 38.802528)rotate(-90)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-107\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_21\">\n",
       "    <!-- 1 -->\n",
       "    <g transform=\"translate(106.268799 21.560896)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-49\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pf600d03959\">\n",
       "   <rect height=\"41.491069\" width=\"117.9612\" x=\"0.602921\" y=\"4.504646\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" height=\"45.995716pt\" version=\"1.1\" viewBox=\"0 0 239.96259 45.995716\" width=\"239.96259pt\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-09-29T16:51:10.302494</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 45.995716  L 239.96259 45.995716  L 239.96259 0  L 0 0  z \" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 8.230781 45.180316  L 13.453661 45.180316  L 13.453661 22.919896  L 8.230781 22.919896  z \" style=\"fill:#cfe2d4;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 33.692321 45.180316  L 56.542421 45.180316  L 56.542421 22.919896  L 33.692321 22.919896  z \" style=\"fill:#cfe2d4;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 76.781081 45.180316  L 82.003961 45.180316  L 82.003961 22.919896  L 76.781081 22.919896  z \" style=\"fill:#cfe2d4;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 102.895481 45.180316  L 108.118361 45.180316  L 108.118361 22.919896  L 102.895481 22.919896  z \" style=\"fill:#cfe2d4;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 154.471421 28.007992  L 177.321521 28.007992  L 177.321521 22.919896  L 154.471421 22.919896  z \" style=\"fill:#fefecd;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 209.964521 28.007992  L 232.814621 28.007992  L 232.814621 22.919896  L 209.964521 22.919896  z \" style=\"fill:#fefecd;stroke:#808080;stroke-linejoin:miter;stroke-width:0.7;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_1\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 6.925061 13.192653  L 14.759381 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_2\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 41.200211 13.192653  L 49.034531 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_3\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 75.475361 13.192653  L 83.309681 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_4\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 101.589761 13.192653  L 109.424081 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_5\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 161.979311 13.192653  L 169.813631 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_6\">\n",
       "    <path clip-path=\"url(#pd89de14d64)\" d=\"M 217.472411 13.192653  L 225.306731 13.192653  \" style=\"fill:none;stroke:#c2c2c2;stroke-linecap:square;stroke-width:0.5;\"/>\n",
       "   </g>\n",
       "   <g id=\"text_1\">\n",
       "    <!-- b -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(7.577921 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 49.703125 25.390625  Q 49.703125 19.28125 48.015625 14.46875  Q 46.34375 9.671875 43.234375 6.328125  Q 40.140625 2.984375 35.6875 1.1875  Q 31.25 -0.59375 25.6875 -0.59375  Q 21.34375 -0.59375 16.796875 0.234375  Q 12.25 1.078125 7.8125 2.875  L 7.8125 69  L 16.3125 69  L 16.3125 50  L 15.921875 40.921875  Q 19.578125 45.84375 23.75 47.875  Q 27.9375 49.90625 32.71875 49.90625  Q 36.921875 49.90625 40.09375 48.140625  Q 43.265625 46.390625 45.40625 43.1875  Q 47.5625 39.984375 48.625 35.46875  Q 49.703125 30.953125 49.703125 25.390625  z M 41.015625 25  Q 41.015625 28.859375 40.453125 32.078125  Q 39.890625 35.296875 38.671875 37.59375  Q 37.453125 39.890625 35.546875 41.1875  Q 33.640625 42.484375 31 42.484375  Q 29.390625 42.484375 27.734375 41.96875  Q 26.078125 41.453125 24.296875 40.25  Q 22.515625 39.0625 20.53125 37.078125  Q 18.5625 35.109375 16.3125 32.171875  L 16.3125 8.40625  Q 18.796875 7.421875 21.375 6.859375  Q 23.96875 6.296875 26.3125 6.296875  Q 29.25 6.296875 31.90625 7.21875  Q 34.578125 8.15625 36.59375 10.328125  Q 38.625 12.5 39.8125 16.078125  Q 41.015625 19.671875 41.015625 25  z \" id=\"Consolas-98\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-98\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_2\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(14.106521 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path id=\"Consolas-32\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_3\">\n",
       "    <!-- = -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(20.635121 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 48.484375 31.546875  L 6.5 31.546875  L 6.5 38.71875  L 48.484375 38.71875  z M 48.484375 14.546875  L 6.5 14.546875  L 6.5 21.734375  L 48.484375 21.734375  z \" id=\"Consolas-61\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-61\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_4\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(27.163721 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_5\">\n",
       "    <!-- W -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(41.853071 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 52.78125 63.8125  L 48.484375 0  L 37.203125 0  L 29.296875 22.703125  L 27.09375 29.984375  L 24.8125 22.125  L 17.484375 0  L 6.59375 0  L 2.203125 63.8125  L 10.40625 63.8125  L 12.890625 20.40625  L 13.625 8.5  L 16.703125 18.609375  L 24.421875 42.28125  L 30.421875 42.28125  L 39.3125 16.890625  L 42.28125 8.5  L 42.484375 17.28125  L 45.015625 63.8125  z \" id=\"Consolas-87\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-87\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_6\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(56.542421 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_7\">\n",
       "    <!-- @ -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(63.071021 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 38.09375 19.921875  Q 37.640625 16.796875 37.59375 14.75  Q 37.546875 12.703125 37.859375 11.53125  Q 38.1875 10.359375 38.859375 9.890625  Q 39.546875 9.421875 40.578125 9.421875  Q 41.9375 9.421875 43.15625 10.859375  Q 44.390625 12.3125 45.34375 15.3125  Q 46.296875 18.3125 46.84375 22.890625  Q 47.40625 27.484375 47.40625 33.796875  Q 47.40625 40.828125 46.53125 46.34375  Q 45.65625 51.859375 43.75 55.71875  Q 41.84375 59.578125 38.796875 61.59375  Q 35.75 63.625 31.390625 63.625  Q 28.078125 63.625 24.96875 61.9375  Q 21.875 60.25 19.203125 57.203125  Q 16.546875 54.15625 14.375 49.875  Q 12.203125 45.609375 10.65625 40.421875  Q 9.125 35.25 8.265625 29.296875  Q 7.421875 23.34375 7.421875 16.890625  Q 7.421875 1.171875 12.15625 -6.5625  Q 16.890625 -14.3125 25.484375 -14.3125  Q 29.828125 -14.3125 33.59375 -13.3125  Q 37.359375 -12.3125 41.40625 -10.296875  L 41.40625 -16.609375  Q 37.40625 -18.453125 33.390625 -19.375  Q 29.390625 -20.3125 25 -20.3125  Q 12.546875 -20.3125 6.5625 -10.984375  Q 0.59375 -1.65625 0.484375 16.796875  Q 0.4375 24.171875 1.453125 30.9375  Q 2.484375 37.703125 4.40625 43.5625  Q 6.34375 49.421875 9.09375 54.21875  Q 11.859375 59.03125 15.34375 62.421875  Q 18.84375 65.828125 22.9375 67.703125  Q 27.046875 69.578125 31.6875 69.578125  Q 37.5 69.578125 41.765625 67.203125  Q 46.046875 64.84375 48.828125 60.375  Q 51.609375 55.90625 52.953125 49.40625  Q 54.296875 42.921875 54.296875 34.625  Q 54.25 26.21875 53.203125 20.234375  Q 52.15625 14.265625 50.25 10.453125  Q 48.34375 6.640625 45.625 4.859375  Q 42.921875 3.078125 39.59375 3.078125  Q 35.796875 3.078125 33.9375 5.03125  Q 32.078125 6.984375 32.078125 10.296875  Q 30.21875 6.546875 28.0625 4.8125  Q 25.921875 3.078125 22.90625 3.078125  Q 18.3125 3.078125 16.015625 6.515625  Q 13.71875 9.96875 13.71875 17.390625  Q 13.71875 20.0625 14.03125 23.140625  Q 14.359375 26.21875 15.109375 29.3125  Q 15.875 32.421875 17.09375 35.28125  Q 18.3125 38.140625 20.09375 40.3125  Q 21.875 42.484375 24.3125 43.796875  Q 26.765625 45.125 29.890625 45.125  Q 31.734375 45.125 33.34375 44.671875  Q 34.96875 44.234375 35.6875 43.796875  L 42 45.3125  z M 33.109375 37.3125  Q 32.671875 37.890625 31.765625 38.34375  Q 30.859375 38.8125 29.5 38.8125  Q 28.03125 38.8125 26.859375 37.78125  Q 25.6875 36.765625 24.78125 35.046875  Q 23.875 33.34375 23.265625 31.171875  Q 22.65625 29 22.234375 26.703125  Q 21.828125 24.421875 21.65625 22.1875  Q 21.484375 19.96875 21.484375 18.21875  Q 21.484375 13.53125 22.0625 11.46875  Q 22.65625 9.421875 24.3125 9.421875  Q 24.90625 9.421875 25.484375 9.65625  Q 26.078125 9.90625 26.734375 10.609375  Q 27.390625 11.328125 28.171875 12.59375  Q 28.953125 13.875 29.890625 15.921875  z \" id=\"Consolas-64\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-64\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_8\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(69.599621 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_9\">\n",
       "    <!-- b -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(76.128221 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-98\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_10\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(82.656821 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_11\">\n",
       "    <!-- + -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(89.185421 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.875 22.90625  L 31.6875 22.90625  L 31.6875 2.984375  L 23.296875 2.984375  L 23.296875 22.90625  L 4.109375 22.90625  L 4.109375 30.328125  L 23.296875 30.328125  L 23.296875 50.09375  L 31.6875 50.09375  L 31.6875 30.328125  L 50.875 30.328125  z \" id=\"Consolas-43\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-43\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_12\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(95.714021 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_13\">\n",
       "    <!-- x -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(102.242621 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 52 0  L 40.71875 0  L 27.484375 18.703125  L 14.40625 0  L 3.421875 0  L 22.40625 24.609375  L 4.296875 49.03125  L 15.1875 49.03125  L 28.078125 30.171875  L 40.71875 49.03125  L 51.21875 49.03125  L 32.8125 24.421875  z \" id=\"Consolas-120\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-120\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_14\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(108.771221 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_15\">\n",
       "    <!-- * -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(115.299821 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 46.921875 41.015625  L 43.609375 35.203125  L 29.890625 44.28125  L 31 27.59375  L 24.03125 27.59375  L 25.09375 44.28125  L 11.078125 35.203125  L 8.015625 40.921875  L 23 48.296875  L 8.015625 55.8125  L 11.375 61.53125  L 25.203125 52.296875  L 24.03125 69  L 31 69  L 29.78125 52.296875  L 43.609375 61.625  L 47.015625 55.609375  L 31.984375 48.1875  z \" id=\"Consolas-42\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-42\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_16\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(121.828421 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_17\">\n",
       "    <!-- 3 -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(128.357021 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 48 19.390625  Q 48 15.1875 46.28125 11.5  Q 44.578125 7.8125 41.15625 5.046875  Q 37.75 2.296875 32.5625 0.703125  Q 27.390625 -0.875 20.515625 -0.875  Q 16.703125 -0.875 13.671875 -0.625  Q 10.640625 -0.390625 8.015625 0  L 8.015625 7.625  Q 11.03125 7.078125 14.40625 6.78125  Q 17.78125 6.5 21.296875 6.5  Q 26.078125 6.5 29.46875 7.34375  Q 32.859375 8.203125 35 9.8125  Q 37.15625 11.421875 38.125 13.71875  Q 39.109375 16.015625 39.109375 18.890625  Q 39.109375 21.53125 37.9375 23.484375  Q 36.765625 25.4375 34.640625 26.75  Q 32.515625 28.078125 29.5625 28.734375  Q 26.609375 29.390625 23.09375 29.390625  L 15.828125 29.390625  L 15.828125 36.375  L 23.1875 36.375  Q 26.078125 36.375 28.4375 37.125  Q 30.8125 37.890625 32.5 39.296875  Q 34.1875 40.71875 35.078125 42.796875  Q 35.984375 44.875 35.984375 47.515625  Q 35.984375 52.640625 32.859375 54.984375  Q 29.734375 57.328125 23.6875 57.328125  Q 20.453125 57.328125 17.03125 56.6875  Q 13.625 56.0625 9.71875 54.78125  L 9.71875 62.203125  Q 11.375 62.796875 13.25 63.25  Q 15.140625 63.71875 17.015625 64.03125  Q 18.890625 64.359375 20.75 64.53125  Q 22.609375 64.703125 24.3125 64.703125  Q 29.390625 64.703125 33.25 63.59375  Q 37.109375 62.5 39.6875 60.453125  Q 42.28125 58.40625 43.59375 55.46875  Q 44.921875 52.546875 44.921875 48.875  Q 44.921875 43.40625 42.109375 39.6875  Q 39.3125 35.984375 34.421875 33.796875  Q 36.921875 33.40625 39.328125 32.234375  Q 41.75 31.0625 43.671875 29.21875  Q 45.609375 27.390625 46.796875 24.890625  Q 48 22.40625 48 19.390625  z \" id=\"Consolas-51\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-51\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_18\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(134.885621 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_19\">\n",
       "    <!-- + -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(141.414221 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-43\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_20\">\n",
       "    <!--   -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(147.942821 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-32\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_21\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(162.632171 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 47.21875 0  L 38.71875 0  L 38.71875 31.296875  Q 38.71875 36.96875 36.59375 39.765625  Q 34.46875 42.578125 30.515625 42.578125  Q 28.8125 42.578125 27.3125 42.109375  Q 25.828125 41.65625 24.21875 40.5  Q 22.609375 39.359375 20.703125 37.40625  Q 18.796875 35.453125 16.3125 32.515625  L 16.3125 0  L 7.8125 0  L 7.8125 69  L 16.3125 69  L 16.3125 49.03125  L 16.015625 41.3125  Q 18.015625 43.703125 19.9375 45.328125  Q 21.875 46.96875 23.796875 48  Q 25.734375 49.03125 27.734375 49.46875  Q 29.734375 49.90625 31.890625 49.90625  Q 39.203125 49.90625 43.203125 45.4375  Q 47.21875 40.96875 47.21875 31.984375  z \" id=\"Consolas-104\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_22\">\n",
       "    <!-- . -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(177.321521 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 27.09375 15.375  Q 28.765625 15.375 30.25 14.734375  Q 31.734375 14.109375 32.828125 12.984375  Q 33.9375 11.859375 34.5625 10.375  Q 35.203125 8.890625 35.203125 7.171875  Q 35.203125 5.515625 34.5625 4.046875  Q 33.9375 2.59375 32.828125 1.484375  Q 31.734375 0.390625 30.25 -0.234375  Q 28.765625 -0.875 27.09375 -0.875  Q 25.390625 -0.875 23.921875 -0.234375  Q 22.46875 0.390625 21.359375 1.484375  Q 20.265625 2.59375 19.625 4.046875  Q 19 5.515625 19 7.171875  Q 19 8.890625 19.625 10.375  Q 20.265625 11.859375 21.359375 12.984375  Q 22.46875 14.109375 23.921875 14.734375  Q 25.390625 15.375 27.09375 15.375  z \" id=\"Consolas-46\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-46\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_23\">\n",
       "    <!-- d -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(183.850121 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 5.328125 23.484375  Q 5.328125 29.734375 7.03125 34.59375  Q 8.734375 39.453125 11.890625 42.796875  Q 15.046875 46.140625 19.453125 47.875  Q 23.875 49.609375 29.296875 49.609375  Q 31.640625 49.609375 33.90625 49.3125  Q 36.1875 49.03125 38.375 48.390625  L 38.375 69  L 46.921875 69  L 46.921875 0  L 39.3125 0  L 39.015625 9.28125  Q 35.453125 4.109375 31.296875 1.609375  Q 27.15625 -0.875 22.3125 -0.875  Q 18.109375 -0.875 14.90625 0.875  Q 11.71875 2.640625 9.59375 5.828125  Q 7.46875 9.03125 6.390625 13.515625  Q 5.328125 18.015625 5.328125 23.484375  z M 14.015625 24.03125  Q 14.015625 15.140625 16.625 10.765625  Q 19.234375 6.390625 24.03125 6.390625  Q 27.25 6.390625 30.828125 9.265625  Q 34.421875 12.15625 38.375 17.828125  L 38.375 40.578125  Q 36.28125 41.546875 33.734375 42.0625  Q 31.203125 42.578125 28.71875 42.578125  Q 21.78125 42.578125 17.890625 38.078125  Q 14.015625 33.59375 14.015625 24.03125  z \" id=\"Consolas-100\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-100\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_24\">\n",
       "    <!-- o -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(190.378721 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.484375 24.90625  Q 50.484375 19.1875 48.875 14.421875  Q 47.265625 9.671875 44.234375 6.265625  Q 41.21875 2.875 36.859375 1  Q 32.515625 -0.875 27 -0.875  Q 21.734375 -0.875 17.546875 0.75  Q 13.375 2.390625 10.46875 5.5625  Q 7.5625 8.734375 6.03125 13.421875  Q 4.5 18.109375 4.5 24.21875  Q 4.5 29.9375 6.109375 34.640625  Q 7.71875 39.359375 10.734375 42.75  Q 13.765625 46.140625 18.109375 48.015625  Q 22.46875 49.90625 27.984375 49.90625  Q 33.25 49.90625 37.421875 48.265625  Q 41.609375 46.625 44.5 43.46875  Q 47.40625 40.328125 48.9375 35.640625  Q 50.484375 30.953125 50.484375 24.90625  z M 41.796875 24.515625  Q 41.796875 29.046875 40.796875 32.4375  Q 39.796875 35.84375 37.9375 38.109375  Q 36.078125 40.375 33.421875 41.515625  Q 30.765625 42.671875 27.484375 42.671875  Q 23.6875 42.671875 20.96875 41.1875  Q 18.265625 39.703125 16.53125 37.203125  Q 14.796875 34.71875 13.984375 31.421875  Q 13.1875 28.125 13.1875 24.515625  Q 13.1875 19.96875 14.1875 16.546875  Q 15.1875 13.140625 17.03125 10.859375  Q 18.890625 8.59375 21.53125 7.4375  Q 24.171875 6.296875 27.484375 6.296875  Q 31.296875 6.296875 34 7.78125  Q 36.71875 9.28125 38.453125 11.765625  Q 40.1875 14.265625 40.984375 17.546875  Q 41.796875 20.84375 41.796875 24.515625  z \" id=\"Consolas-111\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-111\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_25\">\n",
       "    <!-- t -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(196.907321 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 47.3125 0.6875  Q 44.4375 -0.046875 41.359375 -0.359375  Q 38.28125 -0.6875 35.109375 -0.6875  Q 25.875 -0.6875 21.328125 3.484375  Q 16.796875 7.671875 16.796875 16.3125  L 16.796875 41.890625  L 3.078125 41.890625  L 3.078125 49.03125  L 16.796875 49.03125  L 16.796875 62.5  L 25.296875 64.703125  L 25.296875 49.03125  L 47.3125 49.03125  L 47.3125 41.890625  L 25.296875 41.890625  L 25.296875 17  Q 25.296875 11.71875 28.09375 9.109375  Q 30.90625 6.5 36.375 6.5  Q 38.71875 6.5 41.5 6.859375  Q 44.28125 7.234375 47.3125 8.015625  z \" id=\"Consolas-116\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-116\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_26\">\n",
       "    <!-- ( -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(203.435921 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 37.15625 -20.515625  Q 14.65625 0.34375 14.65625 25.59375  Q 14.65625 31.5 15.84375 37.375  Q 17.046875 43.265625 19.703125 49.171875  Q 22.359375 55.078125 26.734375 60.984375  Q 31.109375 66.890625 37.359375 72.703125  L 42.28125 67.671875  Q 23.34375 48.96875 23.34375 26.21875  Q 23.34375 14.890625 28.125 4.4375  Q 32.90625 -6 42.28125 -15.28125  z \" id=\"Consolas-40\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-40\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_27\">\n",
       "    <!-- h -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(218.125271 9.451406)scale(0.13 -0.13)\">\n",
       "     <use xlink:href=\"#Consolas-104\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_28\">\n",
       "    <!-- ) -->\n",
       "    <g style=\"fill:#444443;\" transform=\"translate(232.814621 9.451406)scale(0.13 -0.13)\">\n",
       "     <defs>\n",
       "      <path d=\"M 17.828125 72.703125  Q 40.328125 51.859375 40.328125 26.3125  Q 40.328125 21.046875 39.25 15.375  Q 38.1875 9.71875 35.59375 3.78125  Q 33.015625 -2.15625 28.640625 -8.25  Q 24.265625 -14.359375 17.625 -20.515625  L 12.703125 -15.484375  Q 22.21875 -6.0625 26.90625 4.1875  Q 31.59375 14.453125 31.59375 25.6875  Q 31.59375 48.921875 12.703125 67.484375  z \" id=\"Consolas-41\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#Consolas-41\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_29\">\n",
       "    <!-- 2k -->\n",
       "    <g transform=\"translate(6.442031 38.802528)rotate(-90)scale(0.09 -0.09)\">\n",
       "     <defs>\n",
       "      <path d=\"M 50.34375 8.453125  L 50.34375 0  L 3.03125 0  Q 2.9375 3.171875 4.046875 6.109375  Q 5.859375 10.9375 9.828125 15.625  Q 13.8125 20.3125 21.34375 26.46875  Q 33.015625 36.03125 37.109375 41.625  Q 41.21875 47.21875 41.21875 52.203125  Q 41.21875 57.421875 37.46875 61  Q 33.734375 64.59375 27.734375 64.59375  Q 21.390625 64.59375 17.578125 60.78125  Q 13.765625 56.984375 13.71875 50.25  L 4.6875 51.171875  Q 5.609375 61.28125 11.65625 66.578125  Q 17.71875 71.875 27.9375 71.875  Q 38.234375 71.875 44.234375 66.15625  Q 50.25 60.453125 50.25 52  Q 50.25 47.703125 48.484375 43.546875  Q 46.734375 39.40625 42.65625 34.8125  Q 38.578125 30.21875 29.109375 22.21875  Q 21.1875 15.578125 18.9375 13.203125  Q 16.703125 10.84375 15.234375 8.453125  z \" id=\"ArialMT-50\"/>\n",
       "      <path d=\"M 6.640625 0  L 6.640625 71.578125  L 15.4375 71.578125  L 15.4375 30.765625  L 36.234375 51.859375  L 47.609375 51.859375  L 27.78125 32.625  L 49.609375 0  L 38.765625 0  L 21.625 26.515625  L 15.4375 20.5625  L 15.4375 0  z \" id=\"ArialMT-107\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-107\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_30\">\n",
       "    <!-- 1 -->\n",
       "    <g transform=\"translate(8.339799 21.560896)scale(0.09 -0.09)\">\n",
       "     <defs>\n",
       "      <path d=\"M 37.25 0  L 28.46875 0  L 28.46875 56  Q 25.296875 52.984375 20.140625 49.953125  Q 14.984375 46.921875 10.890625 45.40625  L 10.890625 53.90625  Q 18.265625 57.375 23.78125 62.296875  Q 29.296875 67.234375 31.59375 71.875  L 37.25 71.875  z \" id=\"ArialMT-49\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#ArialMT-49\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_31\">\n",
       "    <!-- 2k -->\n",
       "    <g transform=\"translate(31.903571 38.802528)rotate(-90)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-107\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_32\">\n",
       "    <!-- 2k -->\n",
       "    <g transform=\"translate(40.364949 21.560896)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-107\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_33\">\n",
       "    <!-- 2k -->\n",
       "    <g transform=\"translate(74.992331 38.802528)rotate(-90)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-107\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_34\">\n",
       "    <!-- 1 -->\n",
       "    <g transform=\"translate(76.890099 21.560896)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-49\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_35\">\n",
       "    <!-- 2k -->\n",
       "    <g transform=\"translate(101.106731 38.802528)rotate(-90)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-50\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-107\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_36\">\n",
       "    <!-- 1 -->\n",
       "    <g transform=\"translate(103.004499 21.560896)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-49\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_37\">\n",
       "    <!-- 1m -->\n",
       "    <g transform=\"translate(159.64569 21.560896)scale(0.09 -0.09)\">\n",
       "     <defs>\n",
       "      <path d=\"M 6.59375 0  L 6.59375 51.859375  L 14.453125 51.859375  L 14.453125 44.578125  Q 16.890625 48.390625 20.9375 50.703125  Q 25 53.03125 30.171875 53.03125  Q 35.9375 53.03125 39.625 50.640625  Q 43.3125 48.25 44.828125 43.953125  Q 50.984375 53.03125 60.84375 53.03125  Q 68.5625 53.03125 72.703125 48.75  Q 76.859375 44.484375 76.859375 35.59375  L 76.859375 0  L 68.109375 0  L 68.109375 32.671875  Q 68.109375 37.9375 67.25 40.25  Q 66.40625 42.578125 64.15625 43.984375  Q 61.921875 45.40625 58.890625 45.40625  Q 53.421875 45.40625 49.796875 41.765625  Q 46.1875 38.140625 46.1875 30.125  L 46.1875 0  L 37.40625 0  L 37.40625 33.6875  Q 37.40625 39.546875 35.25 42.46875  Q 33.109375 45.40625 28.21875 45.40625  Q 24.515625 45.40625 21.359375 43.453125  Q 18.21875 41.5 16.796875 37.734375  Q 15.375 33.984375 15.375 26.90625  L 15.375 0  z \" id=\"ArialMT-109\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#ArialMT-49\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-109\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"text_38\">\n",
       "    <!-- 1m -->\n",
       "    <g transform=\"translate(215.13879 21.560896)scale(0.09 -0.09)\">\n",
       "     <use xlink:href=\"#ArialMT-49\"/>\n",
       "     <use x=\"55.615234\" xlink:href=\"#ArialMT-109\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pd89de14d64\">\n",
       "   <rect height=\"41.491069\" width=\"238.7403\" x=\"0.602921\" y=\"4.504646\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "W = torch.rand(size=(2000,2000))\n",
    "b = torch.rand(size=(2000,1))\n",
    "h = torch.rand(size=(1_000_000,))\n",
    "x = torch.rand(size=(2000,1))\n",
    "\n",
    "with tsensor.explain():\n",
    "    a = torch.relu(x)\n",
    "    b = W @ b + x * 3 + h.dot(h)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8339f350-8eef-4dd4-9356-685b1192df25",
   "metadata": {},
   "source": [
    "## Abstract syntax tree (AST) with operand shapes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "3adf24ee-a9c2-4cf5-bfa5-2b8cf245d00d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Generated by graphviz version 2.49.1 (20210923.0004)\n",
       " -->\n",
       "<!-- Title: G Pages: 1 -->\n",
       "<svg width=\"343pt\" height=\"302pt\"\n",
       " viewBox=\"0.00 0.00 343.00 302.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 298)\">\n",
       "<title>G</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-298 339,-298 339,4 -4,4\"/>\n",
       "<!-- leaf140484086217408 -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>leaf140484086217408</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"7,-294 0,-294 0,-258 7,-258 7,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"0\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">h</text>\n",
       "</g>\n",
       "<!-- leaf140484086218128 -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>leaf140484086218128</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"26.5,-294 8.5,-294 8.5,-258 26.5,-258 26.5,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"14\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">=</text>\n",
       "</g>\n",
       "<!-- leaf140484086217408&#45;&gt;leaf140484086218128 -->\n",
       "<!-- leaf140484086218416 -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>leaf140484086218416</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"61,-294 28,-294 28,-258 61,-258 61,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"28\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">torch</text>\n",
       "</g>\n",
       "<!-- leaf140484086218128&#45;&gt;leaf140484086218416 -->\n",
       "<!-- leaf140484086218464 -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>leaf140484086218464</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"69,-294 62,-294 62,-258 69,-258 69,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"62\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">.</text>\n",
       "</g>\n",
       "<!-- leaf140484086218416&#45;&gt;leaf140484086218464 -->\n",
       "<!-- leaf140484086218224 -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>leaf140484086218224</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"97,-294 70,-294 70,-258 97,-258 97,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"70\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">tanh</text>\n",
       "</g>\n",
       "<!-- leaf140484086218464&#45;&gt;leaf140484086218224 -->\n",
       "<!-- leaf140484086218512 -->\n",
       "<g id=\"node6\" class=\"node\">\n",
       "<title>leaf140484086218512</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"105,-294 98,-294 98,-258 105,-258 105,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"98\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">(</text>\n",
       "</g>\n",
       "<!-- leaf140484086218224&#45;&gt;leaf140484086218512 -->\n",
       "<!-- leaf140484086217456 -->\n",
       "<g id=\"node7\" class=\"node\">\n",
       "<title>leaf140484086217456</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"126.5,-294 106.5,-294 106.5,-258 126.5,-258 126.5,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"106.5\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">Whh</text>\n",
       "</g>\n",
       "<!-- leaf140484086218512&#45;&gt;leaf140484086217456 -->\n",
       "<!-- leaf140484086218608 -->\n",
       "<g id=\"node8\" class=\"node\">\n",
       "<title>leaf140484086218608</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"141.5,-294 127.5,-294 127.5,-258 141.5,-258 141.5,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"131\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">@</text>\n",
       "</g>\n",
       "<!-- leaf140484086217456&#45;&gt;leaf140484086218608 -->\n",
       "<!-- leaf140484086217168 -->\n",
       "<g id=\"node9\" class=\"node\">\n",
       "<title>leaf140484086217168</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"150,-294 143,-294 143,-258 150,-258 150,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"143\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">(</text>\n",
       "</g>\n",
       "<!-- leaf140484086218608&#45;&gt;leaf140484086217168 -->\n",
       "<!-- leaf140484086218272 -->\n",
       "<g id=\"node10\" class=\"node\">\n",
       "<title>leaf140484086218272</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"158,-294 151,-294 151,-258 158,-258 158,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"151\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">r</text>\n",
       "</g>\n",
       "<!-- leaf140484086217168&#45;&gt;leaf140484086218272 -->\n",
       "<!-- leaf140484086218704 -->\n",
       "<g id=\"node11\" class=\"node\">\n",
       "<title>leaf140484086218704</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"173.5,-294 159.5,-294 159.5,-258 173.5,-258 173.5,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"163\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">*</text>\n",
       "</g>\n",
       "<!-- leaf140484086218272&#45;&gt;leaf140484086218704 -->\n",
       "<!-- leaf140484086217552 -->\n",
       "<g id=\"node12\" class=\"node\">\n",
       "<title>leaf140484086217552</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"182,-294 175,-294 175,-258 182,-258 182,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"175\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">h</text>\n",
       "</g>\n",
       "<!-- leaf140484086218704&#45;&gt;leaf140484086217552 -->\n",
       "<!-- leaf140484086217648 -->\n",
       "<g id=\"node13\" class=\"node\">\n",
       "<title>leaf140484086217648</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"190,-294 183,-294 183,-258 190,-258 190,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"183\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">)</text>\n",
       "</g>\n",
       "<!-- leaf140484086217552&#45;&gt;leaf140484086217648 -->\n",
       "<!-- leaf140484086217504 -->\n",
       "<g id=\"node14\" class=\"node\">\n",
       "<title>leaf140484086217504</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"220,-294 191,-294 191,-258 220,-258 220,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"202\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">+</text>\n",
       "</g>\n",
       "<!-- leaf140484086217648&#45;&gt;leaf140484086217504 -->\n",
       "<!-- leaf140484086217792 -->\n",
       "<g id=\"node15\" class=\"node\">\n",
       "<title>leaf140484086217792</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"241.5,-294 221.5,-294 221.5,-258 241.5,-258 241.5,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"221.5\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">Uxh</text>\n",
       "</g>\n",
       "<!-- leaf140484086217504&#45;&gt;leaf140484086217792 -->\n",
       "<!-- leaf140484086216976 -->\n",
       "<g id=\"node16\" class=\"node\">\n",
       "<title>leaf140484086216976</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"256.5,-294 242.5,-294 242.5,-258 256.5,-258 256.5,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"246\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">@</text>\n",
       "</g>\n",
       "<!-- leaf140484086217792&#45;&gt;leaf140484086216976 -->\n",
       "<!-- leaf140484086214864 -->\n",
       "<g id=\"node17\" class=\"node\">\n",
       "<title>leaf140484086214864</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"265,-294 258,-294 258,-258 265,-258 265,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"258\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">X</text>\n",
       "</g>\n",
       "<!-- leaf140484086216976&#45;&gt;leaf140484086214864 -->\n",
       "<!-- leaf140484086217072 -->\n",
       "<g id=\"node18\" class=\"node\">\n",
       "<title>leaf140484086217072</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"273,-294 266,-294 266,-258 273,-258 273,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"266\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">.</text>\n",
       "</g>\n",
       "<!-- leaf140484086214864&#45;&gt;leaf140484086217072 -->\n",
       "<!-- leaf140484086217024 -->\n",
       "<g id=\"node19\" class=\"node\">\n",
       "<title>leaf140484086217024</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"281,-294 274,-294 274,-258 281,-258 281,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"274\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">T</text>\n",
       "</g>\n",
       "<!-- leaf140484086217072&#45;&gt;leaf140484086217024 -->\n",
       "<!-- leaf140484086218176 -->\n",
       "<g id=\"node20\" class=\"node\">\n",
       "<title>leaf140484086218176</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"311,-294 282,-294 282,-258 311,-258 311,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"293\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">+</text>\n",
       "</g>\n",
       "<!-- leaf140484086217024&#45;&gt;leaf140484086218176 -->\n",
       "<!-- leaf140484086215008 -->\n",
       "<g id=\"node21\" class=\"node\">\n",
       "<title>leaf140484086215008</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"326.5,-294 312.5,-294 312.5,-258 326.5,-258 326.5,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"312.5\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">bh</text>\n",
       "</g>\n",
       "<!-- leaf140484086218176&#45;&gt;leaf140484086215008 -->\n",
       "<!-- leaf140484086217888 -->\n",
       "<g id=\"node22\" class=\"node\">\n",
       "<title>leaf140484086217888</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"335,-294 328,-294 328,-258 335,-258 335,-294\"/>\n",
       "<text text-anchor=\"start\" x=\"328\" y=\"-272.9\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">)</text>\n",
       "</g>\n",
       "<!-- leaf140484086215008&#45;&gt;leaf140484086217888 -->\n",
       "<!-- node140484086217360 -->\n",
       "<g id=\"node23\" class=\"node\">\n",
       "<title>node140484086217360</title>\n",
       "<polygon fill=\"none\" stroke=\"black\" stroke-width=\"0\" points=\"78.5,-232.5 60.5,-232.5 60.5,-218.5 78.5,-218.5 78.5,-232.5\"/>\n",
       "<text text-anchor=\"start\" x=\"66\" y=\"-222.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#000000\">.</text>\n",
       "</g>\n",
       "<!-- node140484086217360&#45;&gt;leaf140484086218416 -->\n",
       "<g id=\"edge22\" class=\"edge\">\n",
       "<title>node140484086217360&#45;&gt;leaf140484086218416</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M64.77,-235.68C61.58,-241.86 57.29,-250.19 53.47,-257.59\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"65.79,-235.99 66.23,-232.84 63.92,-235.03 65.79,-235.99\"/>\n",
       "</g>\n",
       "<!-- node140484086217360&#45;&gt;leaf140484086218224 -->\n",
       "<g id=\"edge23\" class=\"edge\">\n",
       "<title>node140484086217360&#45;&gt;leaf140484086218224</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M72.25,-236.02C74.02,-242.16 76.38,-250.32 78.47,-257.59\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"73.17,-235.43 71.33,-232.84 71.15,-236.01 73.17,-235.43\"/>\n",
       "</g>\n",
       "<!-- node140484086217744 -->\n",
       "<g id=\"node24\" class=\"node\">\n",
       "<title>node140484086217744</title>\n",
       "<polygon fill=\"#cfe2d4\" stroke=\"black\" stroke-width=\"0\" points=\"176.5,-236 156.5,-236 156.5,-215 176.5,-215 176.5,-236\"/>\n",
       "<text text-anchor=\"start\" x=\"163\" y=\"-227.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">*</text>\n",
       "<text text-anchor=\"start\" x=\"156.5\" y=\"-217.8\" font-family=\"Arial\" font-size=\"9.00\" fill=\"#444443\">1kx1</text>\n",
       "</g>\n",
       "<!-- node140484086217744&#45;&gt;leaf140484086218272 -->\n",
       "<g id=\"edge24\" class=\"edge\">\n",
       "<title>node140484086217744&#45;&gt;leaf140484086218272</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M163.31,-239.39C161.69,-245.92 159.73,-253.87 158.06,-260.6\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"164.37,-239.48 164.07,-236.31 162.33,-238.97 164.37,-239.48\"/>\n",
       "</g>\n",
       "<!-- node140484086217744&#45;&gt;leaf140484086217552 -->\n",
       "<g id=\"edge25\" class=\"edge\">\n",
       "<title>node140484086217744&#45;&gt;leaf140484086217552</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M169.69,-239.39C171.31,-245.92 173.27,-253.87 174.94,-260.6\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"170.67,-238.97 168.93,-236.31 168.63,-239.48 170.67,-238.97\"/>\n",
       "</g>\n",
       "<!-- node140484086215824 -->\n",
       "<g id=\"node25\" class=\"node\">\n",
       "<title>node140484086215824</title>\n",
       "<polygon fill=\"#cfe2d4\" stroke=\"black\" stroke-width=\"0\" points=\"176.5,-193 156.5,-193 156.5,-172 176.5,-172 176.5,-193\"/>\n",
       "<text text-anchor=\"start\" x=\"163\" y=\"-184.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">@</text>\n",
       "<text text-anchor=\"start\" x=\"156.5\" y=\"-174.8\" font-family=\"Arial\" font-size=\"9.00\" fill=\"#444443\">1kx1</text>\n",
       "</g>\n",
       "<!-- node140484086215824&#45;&gt;leaf140484086217456 -->\n",
       "<g id=\"edge26\" class=\"edge\">\n",
       "<title>node140484086215824&#45;&gt;leaf140484086217456</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M159.7,-195.95C150.96,-211.95 135.73,-239.81 125.89,-257.82\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"160.63,-196.43 161.15,-193.29 158.79,-195.42 160.63,-196.43\"/>\n",
       "</g>\n",
       "<!-- node140484086215824&#45;&gt;node140484086217744 -->\n",
       "<g id=\"edge27\" class=\"edge\">\n",
       "<title>node140484086215824&#45;&gt;node140484086217744</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M166.5,-196.21C166.5,-202.19 166.5,-209.21 166.5,-214.76\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"167.55,-196.01 166.5,-193.01 165.45,-196.01 167.55,-196.01\"/>\n",
       "</g>\n",
       "<!-- node140484086218656 -->\n",
       "<g id=\"node26\" class=\"node\">\n",
       "<title>node140484086218656</title>\n",
       "<polygon fill=\"#cfe2d4\" stroke=\"black\" stroke-width=\"0\" points=\"279,-236 244,-236 244,-215 279,-215 279,-236\"/>\n",
       "<text text-anchor=\"start\" x=\"258\" y=\"-227.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">.</text>\n",
       "<text text-anchor=\"start\" x=\"244\" y=\"-217.8\" font-family=\"Arial\" font-size=\"9.00\" fill=\"#444443\">764x200</text>\n",
       "</g>\n",
       "<!-- node140484086218656&#45;&gt;leaf140484086214864 -->\n",
       "<g id=\"edge28\" class=\"edge\">\n",
       "<title>node140484086218656&#45;&gt;leaf140484086214864</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M261.5,-239.35C261.5,-245.05 261.5,-251.83 261.5,-257.93\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"262.55,-239.31 261.5,-236.31 260.45,-239.31 262.55,-239.31\"/>\n",
       "</g>\n",
       "<!-- node140484086218656&#45;&gt;leaf140484086217024 -->\n",
       "<g id=\"edge29\" class=\"edge\">\n",
       "<title>node140484086218656&#45;&gt;leaf140484086217024</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M265.79,-239.49C268.33,-247.21 271.52,-256.89 273.93,-264.19\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"266.67,-238.83 264.74,-236.31 264.68,-239.49 266.67,-238.83\"/>\n",
       "</g>\n",
       "<!-- node140484086218320 -->\n",
       "<g id=\"node27\" class=\"node\">\n",
       "<title>node140484086218320</title>\n",
       "<polygon fill=\"#cfe2d4\" stroke=\"black\" stroke-width=\"0\" points=\"246.5,-193 216.5,-193 216.5,-172 246.5,-172 246.5,-193\"/>\n",
       "<text text-anchor=\"start\" x=\"228\" y=\"-184.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">@</text>\n",
       "<text text-anchor=\"start\" x=\"216.5\" y=\"-174.8\" font-family=\"Arial\" font-size=\"9.00\" fill=\"#444443\">1kx200</text>\n",
       "</g>\n",
       "<!-- node140484086218320&#45;&gt;leaf140484086217792 -->\n",
       "<g id=\"edge30\" class=\"edge\">\n",
       "<title>node140484086218320&#45;&gt;leaf140484086217792</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M231.5,-196.35C231.5,-212.41 231.5,-239.96 231.5,-257.82\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"232.55,-196.29 231.5,-193.29 230.45,-196.29 232.55,-196.29\"/>\n",
       "</g>\n",
       "<!-- node140484086218320&#45;&gt;node140484086218656 -->\n",
       "<g id=\"edge31\" class=\"edge\">\n",
       "<title>node140484086218320&#45;&gt;node140484086218656</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M240.32,-195.55C244.79,-201.67 250.16,-209 254.37,-214.76\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"241.08,-194.81 238.46,-193.01 239.38,-196.05 241.08,-194.81\"/>\n",
       "</g>\n",
       "<!-- node140484630812608 -->\n",
       "<g id=\"node28\" class=\"node\">\n",
       "<title>node140484630812608</title>\n",
       "<polygon fill=\"#cfe2d4\" stroke=\"black\" stroke-width=\"0\" points=\"219.5,-150 189.5,-150 189.5,-129 219.5,-129 219.5,-150\"/>\n",
       "<text text-anchor=\"start\" x=\"201\" y=\"-141.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">+</text>\n",
       "<text text-anchor=\"start\" x=\"189.5\" y=\"-131.8\" font-family=\"Arial\" font-size=\"9.00\" fill=\"#444443\">1kx200</text>\n",
       "</g>\n",
       "<!-- node140484630812608&#45;&gt;node140484086215824 -->\n",
       "<g id=\"edge32\" class=\"edge\">\n",
       "<title>node140484630812608&#45;&gt;node140484086215824</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M193.64,-152.22C187.91,-158.4 180.96,-165.9 175.53,-171.76\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"194.42,-152.92 195.69,-150.01 192.88,-151.5 194.42,-152.92\"/>\n",
       "</g>\n",
       "<!-- node140484630812608&#45;&gt;node140484086218320 -->\n",
       "<g id=\"edge33\" class=\"edge\">\n",
       "<title>node140484630812608&#45;&gt;node140484086218320</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M212.43,-152.55C216.46,-158.67 221.29,-166 225.08,-171.76\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"213.29,-151.94 210.76,-150.01 211.54,-153.09 213.29,-151.94\"/>\n",
       "</g>\n",
       "<!-- node140484630812512 -->\n",
       "<g id=\"node29\" class=\"node\">\n",
       "<title>node140484630812512</title>\n",
       "<polygon fill=\"#cfe2d4\" stroke=\"black\" stroke-width=\"0\" points=\"219.5,-107 189.5,-107 189.5,-86 219.5,-86 219.5,-107\"/>\n",
       "<text text-anchor=\"start\" x=\"201\" y=\"-98.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">+</text>\n",
       "<text text-anchor=\"start\" x=\"189.5\" y=\"-88.8\" font-family=\"Arial\" font-size=\"9.00\" fill=\"#444443\">1kx200</text>\n",
       "</g>\n",
       "<!-- node140484630812512&#45;&gt;leaf140484086215008 -->\n",
       "<g id=\"edge35\" class=\"edge\">\n",
       "<title>node140484630812512&#45;&gt;leaf140484086215008</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M212.39,-109.68C233.69,-142.55 292.1,-232.71 312.42,-264.07\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"213.2,-108.99 210.68,-107.04 211.43,-110.13 213.2,-108.99\"/>\n",
       "</g>\n",
       "<!-- node140484630812512&#45;&gt;node140484630812608 -->\n",
       "<g id=\"edge34\" class=\"edge\">\n",
       "<title>node140484630812512&#45;&gt;node140484630812608</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M204.5,-110.21C204.5,-116.19 204.5,-123.21 204.5,-128.76\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"205.55,-110.01 204.5,-107.01 203.45,-110.01 205.55,-110.01\"/>\n",
       "</g>\n",
       "<!-- node140484630811792 -->\n",
       "<g id=\"node30\" class=\"node\">\n",
       "<title>node140484630811792</title>\n",
       "<polygon fill=\"#cfe2d4\" stroke=\"black\" stroke-width=\"0\" points=\"89.5,-64 49.5,-64 49.5,-43 89.5,-43 89.5,-64\"/>\n",
       "<text text-anchor=\"start\" x=\"49.5\" y=\"-55.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">tanh()</text>\n",
       "<text text-anchor=\"start\" x=\"54.5\" y=\"-45.8\" font-family=\"Arial\" font-size=\"9.00\" fill=\"#444443\">1kx200</text>\n",
       "</g>\n",
       "<!-- node140484630811792&#45;&gt;node140484086217360 -->\n",
       "<g id=\"edge36\" class=\"edge\">\n",
       "<title>node140484630811792&#45;&gt;node140484086217360</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M69.5,-67.24C69.5,-101.35 69.5,-193.81 69.5,-218.42\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"70.55,-67.13 69.5,-64.13 68.45,-67.13 70.55,-67.13\"/>\n",
       "</g>\n",
       "<!-- node140484630811792&#45;&gt;node140484630812512 -->\n",
       "<g id=\"edge37\" class=\"edge\">\n",
       "<title>node140484630811792&#45;&gt;node140484630812512</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M92.66,-61.53C120.26,-69.92 165.61,-83.69 189.19,-90.85\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"92.89,-60.51 89.71,-60.64 92.28,-62.51 92.89,-60.51\"/>\n",
       "</g>\n",
       "<!-- node140484630812848 -->\n",
       "<g id=\"node31\" class=\"node\">\n",
       "<title>node140484630812848</title>\n",
       "<polygon fill=\"#cfe2d4\" stroke=\"black\" stroke-width=\"0\" points=\"44.5,-21 14.5,-21 14.5,0 44.5,0 44.5,-21\"/>\n",
       "<text text-anchor=\"start\" x=\"26\" y=\"-12.4\" font-family=\"Consolas\" font-size=\"12.00\" fill=\"#444443\">=</text>\n",
       "<text text-anchor=\"start\" x=\"14.5\" y=\"-2.8\" font-family=\"Arial\" font-size=\"9.00\" fill=\"#444443\">1kx200</text>\n",
       "</g>\n",
       "<!-- node140484630812848&#45;&gt;leaf140484086217408 -->\n",
       "<g id=\"edge38\" class=\"edge\">\n",
       "<title>node140484630812848&#45;&gt;leaf140484086217408</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M26.75,-24.38C23.49,-40.81 18.5,-70.13 18.5,-95.5 18.5,-95.5 18.5,-95.5 18.5,-183.5 18.5,-211.67 11.49,-244.08 7.05,-261.78\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"27.82,-24.42 27.38,-21.27 25.76,-24.01 27.82,-24.42\"/>\n",
       "</g>\n",
       "<!-- node140484630812848&#45;&gt;node140484630811792 -->\n",
       "<g id=\"edge39\" class=\"edge\">\n",
       "<title>node140484630812848&#45;&gt;node140484630811792</title>\n",
       "<path fill=\"none\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" d=\"M40.94,-23.22C46.97,-29.4 54.28,-36.9 60,-42.76\"/>\n",
       "<polygon fill=\"#6b6b6b\" stroke=\"#6b6b6b\" stroke-width=\"0.5\" points=\"41.62,-22.42 38.78,-21.01 40.12,-23.89 41.62,-22.42\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<tsensor.viz.QuietGraphvizWrapper at 0x7fc56056cca0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n = 200         # number of instances\n",
    "d = 764         # number of instance features\n",
    "nhidden = 1000\n",
    "\n",
    "Whh = torch.eye(nhidden, nhidden)   # Identity matrix\n",
    "Uxh = torch.randn(nhidden, d)\n",
    "bh  = torch.zeros(nhidden, 1)\n",
    "h = torch.randn(nhidden, 1)         # fake previous hidden state h\n",
    "r = torch.randn(nhidden, 1)         # fake this computation\n",
    "X = torch.rand(n,d)                 # fake input\n",
    "\n",
    "tsensor.astviz(\"h = torch.tanh(Whh @ (r*h) + Uxh @ X.T + bh)\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "be09d055-2ab1-422f-a5ab-6559c029a613",
   "metadata": {},
   "source": [
    "## For slides"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dec46212-54af-46ac-8c5a-57023b86b6ca",
   "metadata": {},
   "source": [
    "### Try print statements"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c85c7bde-ecaf-4d2c-b542-6bdcfe23f1ea",
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "\n",
    "n = 200         # number of instances\n",
    "d = 764         # number of instance features\n",
    "nhidden = 256\n",
    "\n",
    "Whh = torch.eye(nhidden, nhidden)   # Identity matrix\n",
    "Uxh = torch.randn(d, nhidden)\n",
    "bh  = torch.zeros(nhidden, 1)\n",
    "h = torch.randn(nhidden, 1)         # fake previous hidden state h\n",
    "r = torch.randn(nhidden, 1)         # fake this computation\n",
    "X = torch.rand(n,d)                 # fake input\n",
    "\n",
    "print(Whh.shape, r.shape, h.shape, Uxh.shape, X.shape, bh.shape)\n",
    "print((r*h).shape)\n",
    "print((Whh@(r*h)).shape)\n",
    "print((Uxh@X.T).shape) # <-- exception!\n",
    "print((Whh@(r*h)+Uxh@X.T).shape)\n",
    "print((Whh@(r*h)+Uxh@X.T+bh).shape)\n",
    "h = torch.tanh(Whh @ (r*h) + Uxh @ X.T + bh)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
